<!-- 载入系统通用设置  -->
<?php include_once($_SERVER['DOCUMENT_ROOT']."/controller/common/common_setting_unit.php"); ?>
<!-- 检查数据库，更新数据库缺少的项  -->
<?php include 'modules/update_table.php'; ?>

<!DOCTYPE html PUBLIC
    "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">


<head>
<?php include_once('modules/head.php'); ?>
</head>


<body>

<div id="topbar">
    <?php include 'modules/topbar.php'; ?>
</div>

<div id="container">

    <div id="maincontent">



        <div id="sidebar">
            <?php include 'modules/sidebar.php'; ?>
        </div>




<div id="content">
            <div class="indexinfo">
                <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
                    <legend><h1>系统信息</h1></legend>
                </fieldset>


                <div class="box"><h6><i class="layui-icon">&#xe629;</i>访问统计</h6><hr class="layui-bg-green">
                    <div class="content">
                        <?
                        $p['item']="distinct ip";
                        $p['table']=$table_Prefix."access_log";
                        ?>

                        <b>本日</b>：<? echo count_by_item($table_Prefix."access_log","date like '%".date("Y-m-d")."%'")?> PV /
                                    <? $p['condition']="date like '%".date("Y-m-d")."%'"; echo count_number($p)?> IP<br/>
                        <b>昨天</b>：<? echo count_by_item($table_Prefix."access_log","date like '%".date("Y-m-d",strtotime("-1 day"))."%'")?> PV /
                                    <? $p['condition']="date like '%".date("Y-m-d",strtotime("-1 day"))."%'";echo count_number($p)?> IP<br/>
                        <b>本月</b>：<? echo count_by_item($table_Prefix."access_log","date like '%".date("Y-m")."%'")?> PV /
                                    <? $p['condition']="date like '%".date("Y-m")."%'";echo count_number($p)?> IP<br/>
                        <b>上月</b>：<? echo count_by_item($table_Prefix."access_log","date like '%".date("Y-m",strtotime("-3 month"))."%'")?> PV /
                                    <? $p['condition']="date like '%".date("Y-m-d",strtotime("-1 month"))."%'";echo count_number($p)?> IP<br/>
                    </div>
                </div>


                <div class="box"><h6><i class="layui-icon">&#xe7ae;</i>续费信息</h6><hr class="layui-bg-green">


                    <div  class="content">
                        <b>服务器续费</b>：<?echo $site['hostexpire']?><br/>
                        <b>服务器续费倒数</b>：<? echo count_days(date("Y-m-d"),$site['hostexpire'])?>日<br/><br/>
                        <p class="single-ellipsis" style="width: 90%;float: left"><b>域名</b>:<?echo $site['domin']?></p><br/>
                        <b>域名续费</b>：<?echo $site['dominexpire']?><br/>
                        <b>域名续费倒数</b>：<? echo count_days(date("Y-m-d"),$site['dominexpire'])?>日<br/>
                    </div>
                </div>


                <div class="box"><h6><i class="layui-icon">&#xe7ae;</i> 系统信息</h6><hr class="layui-bg-green">
                    <div  class="content">
<!--                        <b>数据库使用空间</b>：--><?//echo trans_storage_unit(getDirSize("/data/mysql/evolution"))?><!--;<br/>-->
                        <b>服务器开通时间</b>：<?echo $site['hoststart']?><br/>
                        <b>运行天数</b>：<? echo count_days($site['hoststart'],date("Y-m-d"))?><br/>
                    </div>
                </div>

                <div class="box"><h6><i class="layui-icon">&#xe7ae;</i> 服务器</h6><hr class="layui-bg-green">
                    <div  class="content">

                        <b>使用空间</b>：
                        <a href="javascript:;" onclick="show_message_box('product','365')">
                        <? $suerage=getDirSize("../uploadfiles/".$theme_folder);
                          if($userage<1073741824){echo "<span class='layui-badge layui-bg-green'>非常好</span>";}
                          elseif($userage>3239225472){echo "<span class='layui-badge layui-bg-orange'>空间紧张</span>";}
                        ?>
                        </a>
                        <br class="<?echo trans_storage_unit($suerage)?> <?echo  $suerage?>"/>
                    </div>
                </div>




            </div>

    <br class="clearfloat"/>





        <div class="plateinfo">
            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
                <legend><h1>板块信息</h1></legend>
            </fieldset>
        <ol>





            <? if ($introduce_visible) { ?>
                <li >
                    <label><i class="fa fa-home fa-lg"></i>&nbsp; <? echo $sidebar_name_introduce ?></label>
                    <span>数据总量 <? echo count_detail_publish("introduce", "all"); ?></span>
                    <span>已发布数据 <? echo count_detail_publish("introduce", "1"); ?></span>
                    <span>未发布数据 <? echo count_detail_publish("introduce", "0"); ?></span>
                </li>
            <? } ?>


            <? if ($product_visible) { ?>
                <li >
                    <label><i class="fa fa-inbox fa-lg"></i>&nbsp; <? echo $sidebar_name_product ?></label>
                    <span>数据总量 <? echo count_detail_publish("product", "all"); ?></span>
                    <span>已发布数据 <? echo count_detail_publish("product", "1"); ?></span>
                    <span>未发布数据 <? echo count_detail_publish("product", "0"); ?></span>
                </li>
            <? } ?>

            <? if ($news_visible) { ?>
                <li >
                    <label><i class="fa fa-newspaper-o fa-lg"></i>&nbsp; <? echo $sidebar_name_news ?></label>
                    <span>数据总量 <? echo count_detail_publish("news", "all"); ?></span>
                    <span>已发布数据 <? echo count_detail_publish("news", "1"); ?></span>
                    <span>未发布数据 <? echo count_detail_publish("news", "0"); ?></span>
                </li>
            <? } ?>

            <? if ($project_visible) { ?>
                <li  >
                    <label><i class="fa fa-dropbox fa-lg"></i>&nbsp; <? echo $sidebar_name_project ?></label>
                    <span>数据总量 <? echo count_detail_publish("project", "all"); ?></span>
                    <span>已发布数据 <? echo count_detail_publish("project", "1"); ?></span>
                    <span>未发布数据 <? echo count_detail_publish("project", "0"); ?></span>
                </li>
            <? } ?>


            <? if ($faq_visible) { ?>
                <li  >
                    <label><i class="fa fa-warning  fa-lg"></i>&nbsp; <? echo $sidebar_name_faq ?></label>
                    <span>数据总量 <? echo count_detail_publish("faq", "all"); ?></span>
                    <span>已发布数据 <? echo count_detail_publish("faq", "1"); ?></span>
                    <span>未发布数据 <? echo count_detail_publish("faq", "0"); ?></span>
                </li>
            <? } ?>

            <? if ($recruitment_visible) { ?>
                <li  >
                    <label><i class="fa fa-user-plus  fa-lg"></i>&nbsp; <? echo $sidebar_name_recruitment ?></label>
                    <span>数据总量 <? echo count_detail_publish("recruitment", "all"); ?></span>
                    <span>已发布数据 <? echo count_detail_publish("recruitment", "1"); ?></span>
                    <span>未发布数据 <? echo count_detail_publish("recruitment", "0"); ?></span>
                </li>
            <? } ?>

            <? if ($download_visible) { ?>
                <li  >
                    <label><i class="fa fa-cloud-download  fa-lg"></i>&nbsp; <? echo $sidebar_name_download ?></label>
                    <span>数据总量 <? echo count_detail_publish("download", "all"); ?></span>
                    <span>已发布数据 <? echo count_detail_publish("download", "1"); ?></span>
                    <span>未发布数据 <? echo count_detail_publish("download", "0"); ?></span>
                </li>

            <? } ?>

            <? if ($banner_visible) { ?>
                <li  >
                    <label><i class="fa fa-photo  fa-lg"></i>&nbsp; 横幅广告</label>
                    <span>数据总量 <? echo count_detail_publish("banner", "all"); ?></span>
                    <span>已发布数据 <? echo count_detail_publish("banner", "1"); ?></span>
                    <span>未发布数据 <? echo count_detail_publish("banner", "0"); ?></span>
                </li>

            <? } ?>

            <? if ($gbook_visible) { ?>
                <li class="index_icon_12">
                    <label><i class="fa fa-warning  fa-lg"></i>&nbsp; 客户留言</label>
                    <span>数据总量 <? echo count_detail_publish("gbook", "all"); ?></span>
                    <span>已发布数据 <? echo count_detail_publish("gbook", "1"); ?></span>
                    <span>未发布数据 <? echo count_detail_publish("gbook", "0"); ?></span>
                </li>
            <? } ?>



        </ol></div>







    <div class="box index-clickrate-box">
        <?

        //设置需要搜索的表格的前缀后缀
        $table_Suffix = "detail";
        $table = $table_Prefix . $table_Suffix;

        $clickrate_range=select_lines_all_items($table,"clickrate desc","belong != 'banner'","50");



        ?>

        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
            <legend><h1>访问排行</h1></legend>
        </fieldset>


        <style>
            .index-clickrate-box .number{ float: left;
                background-color: #009688;
                width: 15px;
                height: 25px;
                border-radius: 15px;
                line-height: 27px;
                padding: 0 5px;
                color: #ffffff;
                font-weight: 700;
                text-align: center;
                margin-right: 5px; }
        </style>
        <ol>

            <? for ($i = 0; $i < count($clickrate_range); $i++) {
                ?>
                <li><div class="number"><?echo $i+1?></div>

                    <a href="<? echo $site_domin . "/" . $clickrate_range[$i]['url'] . ".html" ?>">
                        <?
                        if($clickrate_range[$i]['name']){echo $clickrate_range[$i]['name'];}
                        else{echo "&nbsp";} ?>
                    </a>

    <span>
        <? echo $clickrate_range[$i]['clickrate'] ?>
    </span>

                    <?$percent=$clickrate_range[$i]['clickrate']/$clickrate_range[0]['clickrate']*100?>
                    <div class="layui-progress">
                        <div class="layui-progress-bar layui-bg-green" lay-percent="<?echo $percent?>%"></div>
                    </div>

                </li>
                <? ;
            }
            ?>
        </ol>


    </div>



 </div>






<!--content端點01-->
</div>
<!--maincontent端點01-->
<br class="clearfloat"/>
</div>
<!--container端點01-->
</div>

<?php include  ROOT_PATH_."/controller/modules/footer.php"; ?>

<?php

if(@$_COOKIE['screen'] == ''){
		echo '<script type="text/javascript" src="../js/common.js" ></script><script type="text/javascript">$(document).ready(function(e) {getScreen();});</script>';
}
else{
	$screen = $_COOKIE['screen'];
}

?>
</body>
</html>



